package com.yang.common.enums;

import lombok.Getter;

/**
 * @author yangyongsheng
 * @date 2024/7/1 0:17
 * @description
 */
@Getter
public enum ExceptionEnums {

    /*API服务异常------------------------------------------------------start*/
    ERROR_APIKEY(-1,"非法的apikey"),
    IP_NOT_WHITE(-2,"请求的ip不在白名单内"),
    ERROR_SIGN(-3,"无可用签名"),
    ERROR_TEMPLATE(-4,"无可用模板"),
    ERROR_MOBILE(-5,"手机号格式不正确"),
    BALANCE_NOT_ENOUGH(-6,"手客户余额不足"),
    PARAMETER_ERROR(-10,"请求参数不合法！"),
    SNOWFLAKE_OUT_OF_RANGE(-11,"雪花算法的机器id或者服务id超出最大范围！"),
    SNOWFLAKE_TIME_BACK(-12,"雪花算法的服务器出现时间回拨问题！"),
    /*API服务异常-------------------------------------------------------end*/

    /*STRATEGY服务异常------------------------------------------------start*/
    HAVE_DIRTY_WORD(-13,"当前短信内容中包含敏感词信息！"),
    BLACK_GLOBAL(-14,"当前手机号为平台黑名单"),
    BLACK_CLIENT(-15,"当前手机号为客户黑名单"),
    ONE_MINUTE_LIMIT(-16,"1分钟限流规则生效"),
    ONE_HOUR_LIMIT(-17,"1小时限流规则生效"),
    NO_CHANNEL(-18,"没有可用的通道"),
    /*STRATEGY服务异常--------------------------------------------------end*/

    /*SEARCH服务异常------------------------------------------------start*/
    SEARCH_INDEX_ERROR(-19,"添加文档信息失败"),
    SEARCH_UPDATE_ERROR(-20,"更新文档信息失败"),
    /*SEARCH服务异常--------------------------------------------------end*/


    /*通用异常------------------------------------------------------start*/
    UNKNOWN_ERROR(-99,"不可知的错误！")
    /*通用异常-------------------------------------------------------end*/
    ;
    private Integer code;

    private String msg;

    ExceptionEnums(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
